README file to Havranek, T., Irsova, Z., Laslopova, L. & O. Zeynalova: Publication and Attenuation Biases 
               in Measuring Skill Substitution, The Review of Economics and Statistics.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<skill.xlsx>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> contains the full dataset


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<skill.do>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> contains the code for Stata and R and runs on skill.xlsx

> Section "Data preparation" of the code generates additional variables and provides winsorization of data

> Section "Summary statistics" of the code generates 
  * Figure 1 (time trend)
  * Figure A1 (histograms)
  * Figure A2 (boxplot by studies)
  * Figure A3 (boxplot by countries)
  * Figure A4 (patterns in data)
  * Table A2 (summary statistics using simple and weighted means)
  * Table D1 (summary statistics of variables used in BMA)

> Section "Funnel plot" of the code generates 
  * Figure 2 (inverse estimates)
  * Figure C1 (direct estimates)

> Section "FAT-PET" of the code generates
  * output of OLS, FE, BE, IV models to Table 1 and Panel A of Tables C1--C5

> Section "WAAP" of the code generates
  * output of WAAP model to Tables C1--C5

> Section "Caliper tests" of the code generates
  * Figure 3 (histogram of t-statistics to inverse estimates)
  * Table 2 Panel A (caliper tests)

> Section "Stem-based method" of the code
  * contains code for R used to estimate the stem-based model in Tables C1--C5
  * relevant data can be used from data_stem.tar (but also extracted from skill.xlsx)

> Section "Endogenous kink" of the code generates
  * skill_inverse.xlsx containing only part of the data relevant for inverse elasticities
  * output of the endogenous kink model relevant to Table 1 and Tables C1--C5

> Section "Kranz & Putz" of the code entails
  * and R code that uses data from data_selection_model.tar to generate Table C7

> Section "Data preparation" 
  * generates data for use in R and a follow-up section "Bayesian Model Averaging"
  * entails a code for R to generate details of Table 4, Table E1--E5, Figure 4, Figures E1--E7

> Section "Robustness check (OLS)" of the code generates
  * Table 4 (Frequentist check using OLS)

> Section "Frequentist model averaging" of the code entails
  * code for R generating Table 4 (Frequentist model averaging)

> Section "testing the most precise estimates" of the code generates
  * Table C6 

> Section "what drives the direct elasticities" of the code generates
  * Table B1


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<data_stem.tar>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> contains data used to estimate the output of stem-based model in Tables C1-C5 
  using the code in skill.do (section "Stem-based method")


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<data_selection_model.tar>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> contains data used to estimate the output of the selection model in Table 1 and Tables C1--C5
> the output of the selection model in Table 1 and Tables C1--C5 uses R-code by Andrews & Kasy with
  the clustering of standard errors 
> same data are used to estimate the output of Table C7 using the code in skill.do (section "Kranz & Putz")